#include <iostream>
#include <iomanip>
#include <string>

using namespace std;

#include "PhoneOwner.h"
#include "PhoneOwnerImpl.h"
#include "PhoneOwnerFactory.h"

PhoneOwner::~PhoneOwner()  {
	delete m_PhoneOwner;				// delete implementation creted by Factory
	m_PhoneOwner=0;
}

PhoneOwner::PhoneOwner(Subject* s, const string& Impl, string phNumber, double cost ) {
	m_PhoneOwner = PhoneOwnerFactory::CreatePhoneOwner(s, Impl, phNumber, cost);	
	// Use factory to creater PhoneOwner over any implemetations
	// If new implementations will be added the PhoneOwner class willn't be changed !!!
	// the only change will be in Factory
}

void PhoneOwner::printOut() {				// just rederection to implementation class
	m_PhoneOwner->printOut(); 
}

string PhoneOwner::getPhNumber() const {		// just rederection to implementation class
	return m_PhoneOwner->getPhNumber();
}

double PhoneOwner::getCost() const {	// just rederection to implementation class
	return m_PhoneOwner->getCost();
}
